import express from 'express'
const app = express()

import requestList from './src/request.js'

app.use((request, response, next) => {
    console.log(`当前访问：${request.url}`);
    next()
})

requestList.forEach((item) => {
    app.all(item.url, (request, response) => {
        response.send(item.handler(request))
    })
})

app.listen(5001, (err) => {
    if (!err) console.log('微信后台接口启动！http://localhost:5001/api/user/login');
})
